<template>
  <em-cell-group
    v-if="formData"
    :border="false"
  >
    <em-cell
      v-if="type==='text'"
      title="标签"
    >
      <div class="params-input">
        <el-input
          v-model="content"
          placeholder="标签文字"
        />
      </div>
    </em-cell>
    <em-cell
      v-if="type==='image'"
      title="标签图标"
      label="建议图标大小：125px * 30px"
    >
      <image-picker
        v-model="content"
        size="large"
        removable
      />
    </em-cell>
    <em-cell
      v-if="type==='countdown'"
      title="倒计时"
    >
      依据活动时间
    </em-cell>
  </em-cell-group>
</template>

<script>
import ImagePicker from '@/components/ImagePicker'
export default {
  name: 'TagField',
  components: {
    ImagePicker
  },
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data() {
    return {}
  },
  computed: {
    formData() {
      return this.value
    },
    type() {
      return this.formData.type
    },
    content: {
      get() {
        return this.formData.value
      },
      set(v) {
        this.value.value = v
      }
    }
  },
  mounted() {}
}
</script>

